<?php

class Layout extends CI_Controller {

    public $_data = array();
    public $_auth;

    public function __construct() {
        parent::__construct();
        $this->_data['data']['_menu_left'] = $this->_getMenuLeft();
        $this->_data['data']['best_sell']['_best_selling'] = $this->_getBestSelling();
        $this->_data['data']['_numb_cart'] = $this->_getNumbCart();
        $this->_data['data']['_banner'] = $this->_getBanner();
        $this->_data['data']['ads']['_ads'] = $this->_getAds();
        $this->_auth = $this->myclass->checkcustomer();
    }

    public function _getMenuLeft() {
        return $this->mcategories->getParentCat();        
    }
    
    public function _getNumbCart() {
        return count($this->cart->contents());        
    }
    
    public function _getBestSelling() {
        return $this->morders_detail->getBestSelling(2);       
    }
    
    public function _getBanner() {
        return $this->mbanner->fetchAll();       
    }
    
    public function _getAds() {
        return $this->mads->getAds();       
    }


}
